package com.perfectoMobile.utils.hss;


import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;

import junit.framework.SystemTestCase;

public class Hss {

	String userName = "administrator";
	String Password = "!spike2";
	String hssIp = "0.0.0.0";
	Map<String ,Cradle> cradles = new TreeMap<String, Cradle>();
	
	public  Hss(String ip){
		this.hssIp = ip;
		
	}
	
	public void setCradle(String cradleId){
		cradles.put(cradleId, new Cradle(cradleId));
	}
	
	
	public Cradle getCradle(String cradleId){
		try{
			return cradles.get(cradleId);
		}catch(Exception e){
			SystemTestCase.report.report("Cradle "+cradleId+" doesnt exist",false);
			System.err.println(e.getMessage());
			return null;
		}
	}
		
	
		public Cradle getFirstCradle(){
			for(Entry<String, Cradle> entry : cradles.entrySet()) {
			    return entry.getValue();
			}
			return null;
		}
		
		
	
	
	
}
